using System;
using Iesi.Collections.Generic;

namespace MySpreadsheet
{
    public class Cell
    {
        private ISet<string> classes = new HashedSet<string>();

        public Cell()
            : this(null)
        {  }

        public Cell(object value)
        {
            Value = value;
            Id = Guid.NewGuid().ToString();
            Font = new Font();
            Format = new CellFormat();
        }

        public object Value { get; set; }
        public string Id { get; set; }

        public ISet<string> Classes
        {
            get { return classes; }
        }

        public Font Font { get; set; }
        public CellFormat Format { get; set; }

        public void AddClass(string className)
        {
            classes.Add(className);
        }

        public bool HasClass(string className)
        {
            return classes.Contains(className);
        }
    }
}